<template>
  <div class="page bg">
    <Navbarelder title="授权二维码" />
    <div style="padding: 0 16px">
      <div class="code-box f-c a-c j-c">
        <div class="code-title">{{ projectName }}项目授权二维码</div>
        <vue-qr
          v-if="codeUrl"
          :text="codeUrl"
          :size="241"
          :logo-scale="0.2"
        />
        <div class="code-desc">请扫描此二维码以获得管理权限</div>
      </div>
    </div>
  </div>
</template>

<script>
import VueQr from 'vue-qr' // vue2.0
export default {
  name: 'ProjectCode',
  components: {
    VueQr
  },
  data() {
    return {
      projectId: '',
      projectName: '',
      codeUrl: ''
    }
  },
  created() {
    const { projectName, projectId } = this.$route.query
    this.codeUrl = baseUrl + '/#/project-auth?projectId=' + projectId
    this.projectId = projectId
    this.projectName = projectName
  },
  methods: {}
}
</script>

<style scoped lang="scss">
.page {
    background-image: url('~@/assets/my/bg.png');
    ::v-deep .van-nav-bar {
        background-color: transparent;
        .van-icon,
        .van-nav-bar__text {
            color: #000;
        }
    }
    .code-box {
        margin-top: 70px;
        width: 100%;
        height: 382px;
        background: #FFFFFF;
        border-radius: 10px;
        .code-title {
            // height: 16px;
            font-size: 20px;
            font-family: PingFang SC;
            font-weight: bold;
            color: #333333;
            text-align: center;
        }
        .code-img {
            margin: 20px 0;
        }
        .code-desc {
            font-size: 16px;
            font-family: PingFang SC;
            font-weight: 500;
            color: #999999;
        }
    }
}
</style>
